home *** CD-ROM | disk | FTP | other *** search
/ The Complete Utilities To…ka 501 Killer Utilities! / 501 Killer Utilities! (Macworld July 1995).cdr / Programming / OutOfPhase1.1 Source / OutOfPhase Folder / SampleOscControl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-10  |  3.3 KB  |  98 lines  |  [TEXT/KAHL]

  1. /* SampleOscControl.h */
  2.  
  3. #ifndef Included_SampleOscControl_h
  4. #define Included_SampleOscControl_h
  5.  
  6. /* SampleOscControl module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* FixedPoint */
  12. /* 64BitMath */
  13. /* FastFixedPoint */
  14. /* ModulationSpecifier */
  15. /* Multisampler */
  16. /* EnvelopeState */
  17. /* Envelope */
  18. /* LFOGenerator */
  19. /* LFOListSpecifier */
  20. /* SampleConsts */
  21. /* Memory */
  22. /* OscillatorSpecifier */
  23. /* FastModulation */
  24. /* ErrorDaemon */
  25.  
  26. #include "FixedPoint.h"
  27.  
  28. struct SampleTemplateRec;
  29. typedef struct SampleTemplateRec SampleTemplateRec;
  30.  
  31. struct SampleStateRec;
  32. typedef struct SampleStateRec SampleStateRec;
  33.  
  34. /* forwards */
  35. struct OscillatorRec;
  36. struct ArrayRec;
  37. struct ErrorDaemonRec;
  38.  
  39. /* get rid of all cached memory for state or template records */
  40. void                                    FlushSampleOscControl(void);
  41.  
  42. /* perform one envelope update cycle */
  43. void                                    UpdateSampleEnvelopes(SampleStateRec* State);
  44.  
  45. /* dispose of the sample state record */
  46. void                                    DisposeSampleState(SampleStateRec* State);
  47.  
  48. /* dispose of the sample information template */
  49. void                                    DisposeSampleTemplate(SampleTemplateRec* Template);
  50.  
  51. /* create a new sample template */
  52. SampleTemplateRec*        NewSampleTemplate(struct OscillatorRec* Oscillator,
  53.                                                 float EnvelopeTicksPerSecond, long SamplingRate,
  54.                                                 MyBoolean Stereo, MyBoolean TimeInterp, MyBoolean WaveInterp,
  55.                                                 struct ErrorDaemonRec* ErrorDaemon);
  56.  
  57. /* create a new sample state object. */
  58. SampleStateRec*                NewSampleState(SampleTemplateRec* Template,
  59.                                                 float FreqForMultisampling, float Accent1, float Accent2,
  60.                                                 float Accent3, float Accent4, float Loudness, float HurryUp,
  61.                                                 long* PreOriginTimeOut, float StereoPosition,
  62.                                                 float InitialFrequency, float PitchDisplacementDepthLimit,
  63.                                                 float PitchDisplacementRateLimit,
  64.                                                 long PitchDisplacementStartPoint);
  65.  
  66. /* fix up pre-origin time for the sample state object */
  67. void                                    FixUpSampleStatePreOrigin(SampleStateRec* State,
  68.                                                 long ActualPreOrigin);
  69.  
  70. /* set a new frequency for a state object.  used for portamento */
  71. /* and modulation of frequency (vibrato) */
  72. void                                    SampleStateNewFrequency(SampleStateRec* State,
  73.                                                 float NewFrequencyHertz);
  74.  
  75. /* send a key-up signal to one of the oscillators */
  76. void                                    SampleKeyUpSustain1(SampleStateRec* State);
  77. void                                    SampleKeyUpSustain2(SampleStateRec* State);
  78. void                                    SampleKeyUpSustain3(SampleStateRec* State);
  79.  
  80. /* restart a sample oscillator.  this is used for tie continuations */
  81. void                                    RestartSampleState(SampleStateRec* State,
  82.                                                 float NewFreqMultisampling, float NewAccent1, float NewAccent2,
  83.                                                 float NewAccent3, float NewAccent4, float NewLoudness,
  84.                                                 float NewHurryUp, MyBoolean RetriggerEnvelopes,
  85.                                                 float NewStereoPosition, float NewInitialFrequency,
  86.                                                 float PitchDisplacementDepthLimit,
  87.                                                 float PitchDisplacementRateLimit,
  88.                                                 long PitchDisplacementStartPoint);
  89.  
  90. /* generate a sequence of samples (called for each envelope clock) */
  91. void                                    SampleGenSamples(SampleStateRec* State,
  92.                                                 long SampleCount, largefixedsigned* RawBuffer);
  93.  
  94. /* find out if the sample oscillator has finished */
  95. MyBoolean                            SampleIsItFinished(SampleStateRec* State);
  96.  
  97. #endif
  98.